UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0OcUwiF08O4tzhI7OwPVPMKXZ1+tJXRFoYPKoon41E8='
WHERE
key_id = 'ecd7cc5b89763ceac99bb9c2ec673e05453d51174a443dcbe7e2bceaeaa8b511'
AND (
token = '0OcUwiF08O4tzhI7OwPVPMKXZ1+tJXRFoYPKoon41E8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)