UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LQip+1plHrFDtQ6OlFkDRhNpvM62BTiaMeVrJBW4MgY='
WHERE
key_id = '5d8ff986a23cdf8bbd5c7408ece282d0c6cf063d3ffcf55dca7295885e1e4ab6'
AND (
token = 'LQip+1plHrFDtQ6OlFkDRhNpvM62BTiaMeVrJBW4MgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)