UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W93lirAVh1H3HTXBbGr8oXB7LqUwgeDPDd2/NM85JMA='
WHERE
key_id = '17d17e8a9b463a33f06f2df96429bf890da189934ed748a4ef6729cf418ef5a8'
AND (
token = 'W93lirAVh1H3HTXBbGr8oXB7LqUwgeDPDd2/NM85JMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)