UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MSLwoMrORpYaVC03PXzR/8ppO7dbO+/tSPk6oLBAukc='
WHERE
key_id = 'e96bded3f0898ddfdd30a61d0c3ae8e27e3665d488d4c75509e12e029b6b44be'
AND (
token = 'MSLwoMrORpYaVC03PXzR/8ppO7dbO+/tSPk6oLBAukc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)