UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JsdK/P6nmqlGnVb7737623jqlenx8B7ztAmipjoF9o4='
WHERE
key_id = 'b34129f626f62ad5de44fd9d637481bf58f5cdd062db5cb4e2fa64f4d34458f9'
AND (
token = 'JsdK/P6nmqlGnVb7737623jqlenx8B7ztAmipjoF9o4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)