UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vpE3JfE9cnLbxSe1ctz5ohMkp+PUoB9cmo0LdTsd/hA='
WHERE
key_id = '320883d3bb2a89776eadb02cdfb0df8c1cd9296e3a654686014451c31f79e0f4'
AND (
token = 'vpE3JfE9cnLbxSe1ctz5ohMkp+PUoB9cmo0LdTsd/hA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)