UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xgBSP/7x4nOqRxOHnPjkCO+0UH1d0D8fx+N3IgHsB78='
WHERE
key_id = 'e694faf7c8d6a78c347fad6fa6bd493c1156f1797f763f21849b0a26c36f74c9'
AND (
token = 'xgBSP/7x4nOqRxOHnPjkCO+0UH1d0D8fx+N3IgHsB78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)