UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rLB0Maf9QwxAA+uLlQJGJAgZKsnrFw+kLZ3G92QPuNc='
WHERE
key_id = 'bd1717bf9787f5b761ff994465ba8f6e5de18922c7be6ec6ddfbaf9fb6172960'
AND (
token = 'rLB0Maf9QwxAA+uLlQJGJAgZKsnrFw+kLZ3G92QPuNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)