UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bmJUc17ABhZoObvtYmd7I38XupCp8gVl9WJbNACv3Mc=' 
WHERE 
  key_id = 'd1207b02a57a5d1aa9ce7534ce894e07c6698ff8bab15ca7a153dc3f9e8e0bf2' 
  AND (
    token = 'bmJUc17ABhZoObvtYmd7I38XupCp8gVl9WJbNACv3Mc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026