UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Ecv7RkmVTmZKJDR++bfOgkgP/mWKDux07JXks75TNA='
WHERE
key_id = 'a365f304e0299e29a2e4560498d3a4cd892878a826fdc1e068a7053bcb0725f0'
AND (
token = '8Ecv7RkmVTmZKJDR++bfOgkgP/mWKDux07JXks75TNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)