UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lf/T4TuOTpggRkUZeTVbDmvrdYiOZR8BbooJ7T4LiNc=' 
WHERE 
  key_id = 'f1605e42793ded3f0a3ecc57c2aea1f876d12c4c601bedd6ed3103dc7766bc99' 
  AND (
    token = 'Lf/T4TuOTpggRkUZeTVbDmvrdYiOZR8BbooJ7T4LiNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029