UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xg7AOMyoLId/GbDDbxnM/qQB+Dc8NyohNYMYNJ8XpI='
WHERE
key_id = 'd1bed1fc0de46201f0f6b276ef723f6a89ce6dd4816a9be0636b24e7c6a6dbd5'
AND (
token = '1xg7AOMyoLId/GbDDbxnM/qQB+Dc8NyohNYMYNJ8XpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)