UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w/cnKIXHPzQRu3kUofXhqWXP4VEJAvXbHwc9u15KQVY=' 
WHERE 
  key_id = 'e300462d3adcf6306680a58b3f46970e5e1776c254aba32286cc70fb6cafbd2f' 
  AND (
    token = 'w/cnKIXHPzQRu3kUofXhqWXP4VEJAvXbHwc9u15KQVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040