UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0psu+Cql+HpadpQzNn/ecQEzyy1ozgaGHwxFah5Hfi8=' 
WHERE 
  key_id = 'a980aa98b30d83b028795acb2b47628ebccb3b84394c3d7fdac9cbf17179784d' 
  AND (
    token = '0psu+Cql+HpadpQzNn/ecQEzyy1ozgaGHwxFah5Hfi8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039