UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QFi2mBvNSa6D/B9WJT0ZWHnqF6KpON259Tk+QB9NqSY=' 
WHERE 
  key_id = 'ed056a279d40ab78c8247c954831e06c4752735cca9bcf310cd8b580b5464da4' 
  AND (
    token = 'QFi2mBvNSa6D/B9WJT0ZWHnqF6KpON259Tk+QB9NqSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025