UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zPOK/y638cPe+b697tlG1a2WHs8Ztbsg6SG6tIAVqQI='
WHERE
key_id = 'a456dad3951ae0b164ec34f7f20a3de6059dcb4069a92401f69fbc500f8955a9'
AND (
token = 'zPOK/y638cPe+b697tlG1a2WHs8Ztbsg6SG6tIAVqQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)