UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yLQ9AJ0x687WZaKZVNjK9DqfhVCoIXBrhdNcNx26FT0=' 
WHERE 
  key_id = '129a578edee1e0014b9a8351583a319fa0def78f6fe866fee8bd449310841935' 
  AND (
    token = 'yLQ9AJ0x687WZaKZVNjK9DqfhVCoIXBrhdNcNx26FT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034