UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZCqDGjsDc2TOr7jSTpl5itTrDiq4XeDtfu0rHwPpkg8='
WHERE
key_id = '937b8228d73d27166fac88a7a16c91eb956720a7143c585e59bc6acb1c93da62'
AND (
token = 'ZCqDGjsDc2TOr7jSTpl5itTrDiq4XeDtfu0rHwPpkg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)