UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mZ19kcUhDenGs8sdHN/voeEvS0jN0HyZRUZPzvBmrdQ='
WHERE
key_id = '02546698ba9cc86133813d11186d297b2ebbe578c4cf6342a580f0cf7635d29e'
AND (
token = 'mZ19kcUhDenGs8sdHN/voeEvS0jN0HyZRUZPzvBmrdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)