UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Js5llCLdlnukfa5eaXJtkn73fBvV0N6efMehb4gC/eg=' 
WHERE 
  key_id = 'bff1c7f6186167e5a72876452dc4c625a68f4202de0c38ee148e5691c597e96a' 
  AND (
    token = 'Js5llCLdlnukfa5eaXJtkn73fBvV0N6efMehb4gC/eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048