UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WaFrRRDivGS4e8lq1/wWVGHJXXCokldKB+IzzSy9n1Q='
WHERE
key_id = '79aa9d310c3c6b4548c23fc2c18f58f0246c4e48aeda647e5f61d3fc41be2969'
AND (
token = 'WaFrRRDivGS4e8lq1/wWVGHJXXCokldKB+IzzSy9n1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)