UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2SqN1jVXcTdVxclHBLsBn/LpSM/Bnf9xy84jCW4P9FU=' 
WHERE 
  key_id = '86d13c9d351a8a9dea1338c86d473e2ace3150524d44e2636741330e07d1ee9e' 
  AND (
    token = '2SqN1jVXcTdVxclHBLsBn/LpSM/Bnf9xy84jCW4P9FU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036