UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0QCHSx/Zqt5ysB0b8hkFEj8Z+FAmrM/acghTz5Vaem4='
WHERE
key_id = 'ef12275d760d0f71ff34ac92aca67ff32493eff3dd8f60e1c06c83c455e5e600'
AND (
token = '0QCHSx/Zqt5ysB0b8hkFEj8Z+FAmrM/acghTz5Vaem4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)