UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pPALWA+fX5eJw1LiyEaALOjCogO7Gf8LaL24ypDkeao=' 
WHERE 
  key_id = 'f2629542f2e3f0b1d14d0e6e78fe70d4b39ac0344dcbcbfb8150dc930e3466e5' 
  AND (
    token = 'pPALWA+fX5eJw1LiyEaALOjCogO7Gf8LaL24ypDkeao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028