UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PrkbD6d7ZINc12mZfPUQVFox/1/HTA3HDP3i2bLR/3U=' 
WHERE 
  key_id = 'ebef5e370f45df329563214dedc0f7e4d46a4620eaef8a42b196b5b90433d69d' 
  AND (
    token = 'PrkbD6d7ZINc12mZfPUQVFox/1/HTA3HDP3i2bLR/3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052