UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FjppJ5E+8CdxwA3YgbAtbBotEsWXfR3/1DR49nvZVrc=' 
WHERE 
  key_id = 'df1b4619cafe233fb570383ccdb18878b081d47a37bc4a20e0a4a846c4b72334' 
  AND (
    token = 'FjppJ5E+8CdxwA3YgbAtbBotEsWXfR3/1DR49nvZVrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046