UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDXqTxbyMVfy1gsdRwNh292VFpfwVG2dIn5YLXmXWC4='
WHERE
key_id = '0564473bc442254198aaf9d55eadbd68f74442d36f99d95a772bfa665e6c22b1'
AND (
token = 'SDXqTxbyMVfy1gsdRwNh292VFpfwVG2dIn5YLXmXWC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)