UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BJtOVhPI4SWcGbVgGhRzCP+FWj5Dbas9LxanFxsma4k='
WHERE
key_id = '05f0a4e16eae716c69b68da912bc212148dafd9771f2f93c26b675387543148c'
AND (
token = 'BJtOVhPI4SWcGbVgGhRzCP+FWj5Dbas9LxanFxsma4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)