UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mH01BYVHpFvlduFyDXb+QlhpArQxsvrbjv3iELaLtOM=' 
WHERE 
  key_id = 'f03d5888eb4c2d9f645870a52ce94f360d0cb0b87971721072d74e153dc610ad' 
  AND (
    token = 'mH01BYVHpFvlduFyDXb+QlhpArQxsvrbjv3iELaLtOM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030