UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bGWfNyP5UEO6Gz9mhmTH0qsiCfnTAHLthHpCNv3oAVM=' 
WHERE 
  key_id = '92b8f55e90bc534daada8c8ccb01db041f12ccebd238149cc9a4d71ff2599d0c' 
  AND (
    token = 'bGWfNyP5UEO6Gz9mhmTH0qsiCfnTAHLthHpCNv3oAVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034