UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ckEPfn2xhn4TObyyBp4xqQlwB5unC+hQJ9Q5eMKM6us='
WHERE
key_id = '3d1e1831330262c077afef55b7d90db714b604db46db9476d726d59519e99efe'
AND (
token = 'ckEPfn2xhn4TObyyBp4xqQlwB5unC+hQJ9Q5eMKM6us='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)