UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HX38kcchwB1q4AU7bVm9FbV1kdhRCV+7GlwCvHWJaJA='
WHERE
key_id = '11cb26d1f375c51c9f5d91d28b02974102b77268050fa0cc2b216dd8e118ac21'
AND (
token = 'HX38kcchwB1q4AU7bVm9FbV1kdhRCV+7GlwCvHWJaJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)