UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VdZIxueGLlt3hrY6d9p9uhXZNkbI1z8Tfa5FYENEV5U=' 
WHERE 
  key_id = '29df0bfb83a83ed62e77863b491d0c534881b24104d11feabfaee8ab92b8912d' 
  AND (
    token = 'VdZIxueGLlt3hrY6d9p9uhXZNkbI1z8Tfa5FYENEV5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037