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