UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+CMPxKa2KlIrtT7RdswFRVZPbhO2byFZBUJEGRKRUys='
WHERE
key_id = '372071e9900e51d5d07f34b0736ddcbdbdff477f49191a18b4dffb3b3880f1d5'
AND (
token = '+CMPxKa2KlIrtT7RdswFRVZPbhO2byFZBUJEGRKRUys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)