UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CGOk5BXNnL2jhacwr4Pr9zDnFXIeWsBKlPLNmvwGYXc=' 
WHERE 
  key_id = '2c0ab8aa93c0e99e6864a49ca3c9229ff717dc194e641c00362c5da717f19e2e' 
  AND (
    token = 'CGOk5BXNnL2jhacwr4Pr9zDnFXIeWsBKlPLNmvwGYXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029