UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IZbKPpD89Vi6C20gJx2yVHkEoWM+lJPyVjQli4YzfK0=' 
WHERE 
  key_id = 'd0adb7d8a3a0d29a510edbdd93f1e1bf73c4e3f27aba9ebd069fca24e435ff27' 
  AND (
    token = 'IZbKPpD89Vi6C20gJx2yVHkEoWM+lJPyVjQli4YzfK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023