UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tC81Zt3o7X3hZfP/wSXtPDsXUF/ACljRwGvJ3zs3gaQ='
WHERE
key_id = 'a99cae7b67fc719f9469314d45d37af7bc556da880c5e1ab512b6814121e4057'
AND (
token = 'tC81Zt3o7X3hZfP/wSXtPDsXUF/ACljRwGvJ3zs3gaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)