UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5njKDr0dg+pED0w7mpEJly7PRmxdzVUCie0XApo7EtU='
WHERE
key_id = '4ab40c803cfd70d481c06138d17ff863e1bbffcd1dc2f6100e617d3aec67f124'
AND (
token = '5njKDr0dg+pED0w7mpEJly7PRmxdzVUCie0XApo7EtU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)