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

Query time 0.00031