UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rdNFUW2GqizpkAxx0Q2pG/uwbVZNaFVZK28yir7UkQ=' 
WHERE 
  key_id = 'db8832eb30a40c9c5e7ed94e592bb99355f8a7cd8eb9e0cf054d6793274f8888' 
  AND (
    token = '3rdNFUW2GqizpkAxx0Q2pG/uwbVZNaFVZK28yir7UkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086