UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1yvebhtV2qsK6ECMoY9FqUi2yrPsUVRY4TpudrM8bZA='
WHERE
key_id = '070d8a087c94f9d8aa39b3a6cdec963510d33a59df2ed9a13066f6590a0c3b2a'
AND (
token = '1yvebhtV2qsK6ECMoY9FqUi2yrPsUVRY4TpudrM8bZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)