UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9j7WWUXhcDNPyVCb5Wp0fB62lWCjnVQ/VBnZh6PGJtc=' 
WHERE 
  key_id = 'eb66cb6607623e486a322af0d7d7735ab7dc8e25b7fb940ffd48ff73d63b0340' 
  AND (
    token = '9j7WWUXhcDNPyVCb5Wp0fB62lWCjnVQ/VBnZh6PGJtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044