UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qpyVFUHXZBzXw2IunIgZGMSvNH+vd/HJloDX2KsJxNs='
WHERE
key_id = 'e52cc61d7e24d12f245aa86fef80a958e758276598dced98b0c551e4227f6b4e'
AND (
token = 'qpyVFUHXZBzXw2IunIgZGMSvNH+vd/HJloDX2KsJxNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)