UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IcGD6Fmb3Uiw2qdqqRSsLxOspJVO02eNNXviOUtGjaI='
WHERE
key_id = '0e78f5dc7fbbb1d7f8cd231587ae1e80183ab10827c875c2deea2e7cab486a76'
AND (
token = 'IcGD6Fmb3Uiw2qdqqRSsLxOspJVO02eNNXviOUtGjaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)