UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b8osnDrKNOr2nmQSHYX/XRVxzJ1sihT26GBD6luCvRc=' 
WHERE 
  key_id = '3a63da2bc95e989e97177442f9e80ccf29e0e759c4b91695a5f51b8a1d129d28' 
  AND (
    token = 'b8osnDrKNOr2nmQSHYX/XRVxzJ1sihT26GBD6luCvRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025