UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WHULt6EEOZ/ruKeq7RAAAjKFXC5WYoz4ma6FTMshqok=' 
WHERE 
  key_id = '2f3c32387ae2c700428330533067e98b2689a926d39accb6de55d7d3970ce408' 
  AND (
    token = 'WHULt6EEOZ/ruKeq7RAAAjKFXC5WYoz4ma6FTMshqok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037