UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D/4QUv0ru/d4fszVyDmKPUK/9xkq27yL4HsksVltR/E=' 
WHERE 
  key_id = '25f5e059f1697472a52dba4bc349b130e30c5cab7dd3ff73ab864e6e49477b7b' 
  AND (
    token = 'D/4QUv0ru/d4fszVyDmKPUK/9xkq27yL4HsksVltR/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047