UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PF9wx3IQbZWSWmg/sKPBtb7dj0bgRRWYgJwZRZUiNSA='
WHERE
key_id = '69f20cad9d47ab879bc9d173627cac9a5774d0603a77bb03f36d92d72f00b69a'
AND (
token = 'PF9wx3IQbZWSWmg/sKPBtb7dj0bgRRWYgJwZRZUiNSA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)