UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nz3bd6pIuh4VymtoGNVoIMHNOHUEUKnfQLxtj6NpWys='
WHERE
key_id = 'dcfb80c4fa6ff161d6fbe49bbcf00c4cbd7fc37da1429319e8da02feb9524b19'
AND (
token = 'nz3bd6pIuh4VymtoGNVoIMHNOHUEUKnfQLxtj6NpWys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)