UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VKhFLhCTw8GlvVDkb+ZXSrmOgwLIENiFWQQNALBm79g=' 
WHERE 
  key_id = '77cc05b407dabcfa25e76272dce1195a319e6e71101f1c37368bbe81d105cd84' 
  AND (
    token = 'VKhFLhCTw8GlvVDkb+ZXSrmOgwLIENiFWQQNALBm79g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039