UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1RaB5RmNA9fd43x6nXWZhEGAky1VTOgNauLyBTuZEN8='
WHERE
key_id = '205879ea281bfdd1745ee93828dba3320cb608f7eab78736ce91c78c24679d65'
AND (
token = '1RaB5RmNA9fd43x6nXWZhEGAky1VTOgNauLyBTuZEN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)