UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qbjsd0a9oPLZ70KfQj+CYCy38OYqjaoa3q3NRkEy7jM=' 
WHERE 
  key_id = '935735fdea21f7a1d8a00964d56431e6e667c711308baf9a8a2209870f2582aa' 
  AND (
    token = 'Qbjsd0a9oPLZ70KfQj+CYCy38OYqjaoa3q3NRkEy7jM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020