UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'spksOSgja7hGNME0Oqlv2BHXLaISEt14+emKwVBQBxQ='
WHERE
key_id = '650eaf75fe256ea1f63e4085f85e2bf65fc0a089c9a3effaa8d355a11aee36c2'
AND (
token = 'spksOSgja7hGNME0Oqlv2BHXLaISEt14+emKwVBQBxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)