UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xaJ2YthoXMQeE94LC/5Xd97LW3o2WDqYZedFn1pFsOg='
WHERE
key_id = '641fbc4d042329c06c6c7899798d6f70e4c6e0494566f661f294933e4091ad92'
AND (
token = 'xaJ2YthoXMQeE94LC/5Xd97LW3o2WDqYZedFn1pFsOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)