UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vcot3184s38uglgHdNTxL2zpuj1O7yJA/lZpF23Y0hI=' 
WHERE 
  key_id = '9bb046f19612d7730e294d8e1fdf554013ac931cf1e4cd07b8ecd14dcc1db769' 
  AND (
    token = 'Vcot3184s38uglgHdNTxL2zpuj1O7yJA/lZpF23Y0hI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026