UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uRnT/E5IGf1kJkB/vtBAcxkVWD8M+ItPVV9qCQssgok='
WHERE
key_id = '59495f725d30aba1984ec3dcdc1cdcb64c94e9a31acd4dc4f8521c0889323935'
AND (
token = 'uRnT/E5IGf1kJkB/vtBAcxkVWD8M+ItPVV9qCQssgok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)