UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zl/8HfZ0ZbiMWR/4UPCsae7pzq7SW9RMVScDMxssqqI=' 
WHERE 
  key_id = 'c84569ed86aeea9fb84f8ede35e11f729a637c183f935c8f7133a4e3f590c4f9' 
  AND (
    token = 'zl/8HfZ0ZbiMWR/4UPCsae7pzq7SW9RMVScDMxssqqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032