UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vC1drywZ2cHDk71bSru7T33pxsY9W5aC1QKRDG5NAFY='
WHERE
key_id = '65b615fa52c31f14c5bf34328a3096a648c863a250bc167e983ef833ce74beba'
AND (
token = 'vC1drywZ2cHDk71bSru7T33pxsY9W5aC1QKRDG5NAFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)