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

Query time 0.00046