UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LM5imf1kpZxEXh2i3H6e+vDxI33+W2zPMCzC80UzXZo=' 
WHERE 
  key_id = 'f8fe41c5f5e423743b93885df9e502b17b4b50ce9c31faffccd53a821f281250' 
  AND (
    token = 'LM5imf1kpZxEXh2i3H6e+vDxI33+W2zPMCzC80UzXZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023