UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AipxHb1yS5J3XurqdqxJrMO39nzqrBHPPR4OkTszAEE='
WHERE
key_id = 'fe3da85c1d641301ab1372d7557590e5cc908c4aca713380bc9727bb8804c2c7'
AND (
token = 'AipxHb1yS5J3XurqdqxJrMO39nzqrBHPPR4OkTszAEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)