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