UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5CM9fU7VnpaxKzLLIP7Gm2NjhcraBWG4LOtSd/U1xEY=' 
WHERE 
  key_id = '24611886abc92e58db8b87a3297a40e3466ec63207300c28d01dcdcd591480b1' 
  AND (
    token = '5CM9fU7VnpaxKzLLIP7Gm2NjhcraBWG4LOtSd/U1xEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040