UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mzpE+J/ZAPRLUhHlvlwKxSEb0/EHoWpMDY57ruQoX7U='
WHERE
key_id = '51e296fadd14bcc8374ac1d39c1224aef3167772eb4757759d43c3d427a85733'
AND (
token = 'mzpE+J/ZAPRLUhHlvlwKxSEb0/EHoWpMDY57ruQoX7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)